{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 多项式回归"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "x = np.random.uniform(-3, 3, 100)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "X = x.reshape(-1, 1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "y = 0.5 * x ** 2 + x + 2 + np.random.normal(0., 1, size = 100)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(100, 1)"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(100,)"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD8CAYAAABn919SAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4wLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvpW3flQAAGTxJREFUeJzt3X+MZWV9x/HPd4dRZrU6NExbGdguTcgiorBlY01pjIJ2abGwFRVNNVbbbExqBaJbF01E2hi22forTdN0o7SaUEVgO0WhXaxgrESsu85uV35sJRJkByprZfwBo8zO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g6X3uvrfiISVmZmOS/kfSayUdlvQtSW9x9/sqHVhGZvZKST+T9Fl3P7vq8eRhZi+S9CJ3/7aZ/ZKkfZK21PH/jZmZpOe5+8/MbFzS1yVd4e73FPF6tZihd4N5x/Mkxf8pNIC73+HuRztf3iPp1CrHk4e73+/udT1c9OWSHnT377n705I+L+nSiseUmbt/TdKPqh5HCO7+mLt/u/P7n0q6X1It+zf7sp91vhzv/FdY/KpFQJckM/uImT0i6Y8kfajq8QTyTkn/VvUgWmpa0iMrvj6smgaNJjOz9ZI2SvpmtSPJzszGzGy/pMclfdndC7uWaAK6mf2HmX2nz3+XSpK7f9DdT5N0g6R3Vzva4UZdS+c5H5R0VMvXE60k11JT1uex2t75NZGZPV/SLZKu7LlLrxV3X3L3c7V8N/5yMyssJRbNiUXu/pqET/1nSbdJuqbA4eQy6lrM7O2SXifpQo98ESPF/5e6OSzptBVfnyrp0YrGgh6dfPMtkm5w991VjycEd583s69KukhSIYvX0czQhzGzM1Z8eYmkB6oaS15mdpGk90u6xN2fqno8LfYtSWeY2elm9hxJb5Z0a8Vjgp5ZSPy0pPvd/WNVjycPM5vqVrKZ2YSk16jA+FWXKpdbJG3QckXFw5Le5e5z1Y4qGzN7UNJzJf1f56F7alyx84eS/lbSlKR5SfvdfXO1o0rOzH5f0ickjUm63t0/UvGQMjOzz0l6lZa7+v1A0jXu/ulKB5WRmf2OpP+UdFDL73lJ+oC7317dqLIxs5dJ+oyW/42tkfQFd//Lwl6vDgEdADBaLVIuAIDRCOgA0BAEdABoCAI6ADQEAR0AGoKADgANQUAHgIYgoANAQ/w/3sTaFJ8yzScAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x10a0178d0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.scatter(X, y)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.linear_model import LinearRegression"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "lin_clf = LinearRegression()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "LinearRegression(copy_X=True, fit_intercept=True, n_jobs=1, normalize=False)"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "lin_clf.fit(X, y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "y_predict = lin_clf.predict(X)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(100,)"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y_predict.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD8CAYAAABn919SAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4wLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvpW3flQAAHldJREFUeJzt3X+QXFWVB/DvyTCQiQgTIeyaCTHRooKIksgUq2aLYgEJawRmQX4VIAStkFShSSoMDhBApNjEikJ0awFT/ArKys/sGAxrUIIloLBMmGQjhCwpWCFNVsbFEZABJpOzf3R3uqfn/X73/br9/VRRk+nu6Xd7mD5933nnniuqCiIiKr5xWQ+AiIjMYEAnIrIEAzoRkSUY0ImILMGATkRkCQZ0IiJLMKATEVmCAZ2IyBIM6EREltgnzYMdfPDBOm3atDQPSURUeJs2bfqTqk7ye1yqAX3atGno6+tL85BERIUnIn8I8jimXIiILMGATkRkCQZ0IiJLMK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wAsUNVStqOKRkR2ANgPwP9Vbnq6wBU7/wTgXwBMAjAIYLOqzsl2VMGJyJcArALQAuAOVb0h4yFFJiI/BXAcyl39/gjgWlW9PdNBRSQifw/gCQBbUX7PA8CVqvpIdqOKRkQ+A2ANyn9j4wDcr6rfSex4RQjoRETkrxApFyIi8seATkRkCQZ0IiJLMKATEVmCAZ2IyBIM6ERElmBAJyKyBAM6EZEl/h/CYEdxpS/pkAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1a148e4278>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.scatter(X, y)\n",
    "plt.plot(X, y_predict, color= 'r')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(100, 1)"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(X**2).shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [],
   "source": [
    "X2 = np.hstack([X, X**2])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(100, 2)"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X2.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [],
   "source": [
    "lin_clf2 = LinearRegression()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "LinearRegression(copy_X=True, fit_intercept=True, n_jobs=1, normalize=False)"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "lin_clf2.fit(X2, y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [],
   "source": [
    "y_predict2 = lin_clf2.predict(X2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(100,)"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y_predict2.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD8CAYAAABn919SAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4wLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvpW3flQAAIABJREFUeJzt3Xl8VNX5x/HPIQQIIAQlKkQoVBGKogIRVLQqqKBsEahbsSpS3IqKCKLWrRZBsS51qxsudQMBI4hlUbEqAhoMVBBQiz8KAUtEUxEChOT8/rgJJmH2uTNzZ+b7fr3ygkxuZs4kmWfOfe5znmOstYiISPKrl+gBiIiIOxTQRURShAK6iEiKUEAXEUkRCugiIilCAV1EJEUooIuIpAgFdBGRFKGALiKSIurH88Fatmxp27VrF8+HFBFJesuXL//OWpsT7Li4BvR27dpRWFgYz4cUEUl6xpgNoRynlIuISIpQQBcRSREK6CIiKUIBXUQkRSigi4ikiLhWuYiIpIKComKmzF/H5tIyWmdnMa5vR/K75iZ6WMFn6MaYqcaYrcaYVTVuO9AYs9AY81XVvy1iO0wREW8oKCrm5lmfU1xahgWKS8u4edbnFBQVJ3poIaVcngf61bltAvCutbYD8G7V5yIiKW/K/HWUlVfUuq2svIIp89claEQ/CxrQrbUfAN/XuXkw8ELV/18A8l0el4iIJ20uLQvr9niK9KLoIdbaLQBV/x7s3pBERLyrdXZWWLfHU8yrXIwxo4wxhcaYwpKSklg/nIhITI3r25GszIxat2VlZjCub8cEjehnkQb0/xpjWgF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ZSbQEaeiYgNwpbW2OLGjiowx5mugIbCt6qalSVyxcy7wCJADlAIrrLV9Ezuq0BljzgEeAjKAqdbaiQkeUsSMMa8Cp+F09fsvcIe19tmEDipCxpiTgQ+Bz3Fe8wC3WGvfTtyoImOMOQZ4AedvrB4w3Vr7p5g9XjIEdBERCS4pUi4iIhKcArqISIpQQBcRSREK6CIiKUIBXUQkRSigi4ikCAV0EZEUoYAuIpIi/h9ELDRia7LTYAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1a1452ce48>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.scatter(x, y)\n",
    "plt.plot(np.sort(x), y_predict2[np.argsort(x)], color= 'r')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 0.87185097,  0.56450651])"
      ]
     },
     "execution_count": 38,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "lin_clf2.coef_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1.9070382075727197"
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "lin_clf2.intercept_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
